Skip to content

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Oct 3, 2025

It's gotten on a hot path but only for use within debug!.

r? @saethlin

It's gotten on a hot path but only for use within `debug!`.
They both have a single use. (They can't be united, though, because
`self.colors` might change between the two `get` calls.)
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 3, 2025
@nnethercote
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 3, 2025
Avoid getting `dep_dep_node` unnecessarily.
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 3, 2025
Copy link
Member

@hkBst hkBst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change seems obviously good, since it avoids a function call on both Some branches of the match, which only need the result for debugging information.

I have no idea of the potential performance impact of this, but I'm curious to see the results of the perf run.

View changes since this review

@rust-bors
Copy link

rust-bors bot commented Oct 3, 2025

☀️ Try build successful (CI)
Build commit: 7b6fbc1 (7b6fbc1b2e10c887bd6f992a6f0525a844b1ac01, parent: 3b8665c5ab3aeced9b01672404c3764583e722ca)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7b6fbc1): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 2
Improvements ✅
(primary)
-1.4% [-3.5%, -0.2%] 110
Improvements ✅
(secondary)
-1.1% [-2.6%, -0.2%] 57
All ❌✅ (primary) -1.4% [-3.5%, -0.2%] 110

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (primary -2.8%, secondary -2.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-3.6%, -2.2%] 17
Improvements ✅
(secondary)
-2.7% [-3.4%, -2.0%] 2
All ❌✅ (primary) -2.8% [-3.6%, -2.2%] 17

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 472.69s -> 471.95s (-0.16%)
Artifact size: 387.73 MiB -> 387.81 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 3, 2025
@nnethercote nnethercote marked this pull request as ready for review October 3, 2025 20:53
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 3, 2025
@nnethercote
Copy link
Contributor Author

The icount results were almost twice as good as what I saw locally. And there are even some green cycle count results, which is nice, and uncommon for a micro-optimization like this.

There are a few double-digit wall-time regressions, but only among secondary benchmarks, and only among the really short-running ones, which appear to be prone to large swings with some frequency; the change is so simple that I think they can be ignored.

r? @saethlin

@saethlin
Copy link
Member

saethlin commented Oct 4, 2025

Can you write a little PR description? Then r=me.

@saethlin saethlin added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 4, 2025

Requested reviewer is already assigned to this pull request.

Please choose another assignee.

@nnethercote
Copy link
Contributor Author

@bors r=saethlin

@bors
Copy link
Collaborator

bors commented Oct 4, 2025

📌 Commit 3a287e6 has been approved by saethlin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 4, 2025
@bors
Copy link
Collaborator

bors commented Oct 4, 2025

⌛ Testing commit 3a287e6 with merge 227ac7c...

@bors
Copy link
Collaborator

bors commented Oct 5, 2025

☀️ Test successful - checks-actions
Approved by: saethlin
Pushing 227ac7c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 5, 2025
@bors bors merged commit 227ac7c into rust-lang:master Oct 5, 2025
12 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 5, 2025
Copy link
Contributor

github-actions bot commented Oct 5, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 2cb4e7d (parent) -> 227ac7c (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 227ac7c3cd486872d5c2352b3df02b571500e53a --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. pr-check-1: 1356.0s -> 1667.5s (23.0%)
  2. dist-apple-various: 4123.7s -> 3276.8s (-20.5%)
  3. aarch64-gnu-debug: 3702.5s -> 4280.0s (15.6%)
  4. i686-gnu-nopt-1: 7087.9s -> 8026.6s (13.2%)
  5. aarch64-gnu-llvm-20-1: 3248.1s -> 3674.2s (13.1%)
  6. x86_64-gnu-llvm-20-3: 6075.5s -> 6857.5s (12.9%)
  7. x86_64-rust-for-linux: 2617.2s -> 2941.0s (12.4%)
  8. dist-ohos-aarch64: 4195.5s -> 4672.6s (11.4%)
  9. dist-various-1: 3993.2s -> 3581.4s (-10.3%)
  10. aarch64-gnu-llvm-20-2: 2153.4s -> 2366.6s (9.9%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (227ac7c): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.9% [0.8%, 1.0%] 6
Improvements ✅
(primary)
-1.3% [-3.5%, -0.2%] 115
Improvements ✅
(secondary)
-1.1% [-2.6%, -0.2%] 61
All ❌✅ (primary) -1.3% [-3.5%, -0.2%] 115

Max RSS (memory usage)

Results (primary 2.7%, secondary 2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.7% [0.7%, 4.6%] 2
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [0.7%, 4.6%] 2

Cycles

Results (primary -3.0%, secondary -3.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.0% [-4.9%, -2.0%] 16
Improvements ✅
(secondary)
-3.1% [-3.9%, -2.1%] 3
All ❌✅ (primary) -3.0% [-4.9%, -2.0%] 16

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 471.593s -> 470.078s (-0.32%)
Artifact size: 388.35 MiB -> 388.29 MiB (-0.02%)

@rustbot rustbot added the perf-regression Performance regression. label Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants